<template>
  <a-layout style="min-height: 100vh;">
    <!-- 左侧菜单 -->
    <a-layout-sider width="200" style="background: #fff; position: fixed; left: 0; top: 65px; bottom: 0; overflow-y: auto;">
      <a-menu
          v-model:selectedKeys="selectedKeys2"
          v-model:openKeys="openKeys"
          mode="inline"
          :style="{ borderRight: 0 }"
      >
        <a-sub-menu key="sub1">
          <template #title>
              <span>
                <user-outlined/>
                用户与企业
              </span>
          </template>
          <a-menu-item key="/admin/users">
            <router-link to="/admin/users">用户管理</router-link>
          </a-menu-item>
          <a-menu-item key="/admin/companies">
            <router-link to="/admin/companies">企业管理</router-link>
          </a-menu-item>
        </a-sub-menu>
        <a-sub-menu key="sub2">
          <template #title>
              <span>
                <laptop-outlined/>
                职位
              </span>
          </template>
          <a-menu-item key="/admin/jobs">
            <router-link to="/admin/jobs">职位管理</router-link>
          </a-menu-item>
          <a-menu-item key="/admin/skill">
            <router-link to="/admin/skill">技能标签管理</router-link>
          </a-menu-item>
        </a-sub-menu>
        <a-sub-menu key="sub3">
          <template #title>
              <span>
                <notification-outlined/>
                简历
              </span>
          </template>
          <a-menu-item key="/admin/resumes">
            <router-link to="/admin/resumes">简历管理</router-link>
          </a-menu-item>
          <a-menu-item key="/admin/application">
            <router-link to="/admin/application">职位投递管理</router-link>
          </a-menu-item>
        </a-sub-menu>
        <a-sub-menu key="sub4">
          <template #title>
              <span>
                <notification-outlined/>
                消息
              </span>
          </template>
          <a-menu-item key="/admin/messages">
            <router-link to="/admin/messages">消息管理</router-link>
          </a-menu-item>
        </a-sub-menu>
        <a-sub-menu key="sub5">
          <template #title>
              <span>
                <notification-outlined/>
                用户操作
              </span>
          </template>
          <a-menu-item key="/admin/favorite">
            <router-link to="/admin/favorite">收藏管理</router-link>
          </a-menu-item>
          <a-menu-item key="/admin/history">
            <router-link to="/admin/history">搜索记录管理</router-link>
          </a-menu-item>
        </a-sub-menu>
      </a-menu>
    </a-layout-sider>
<!--     内容区-->
    <a-layout style="margin-left: 200px;">
      <a-layout-content :style="{ background: '#fff', padding: '24px', minHeight: '100vh', overflowY: 'auto',marginTop: '24px'}">
        <router-view />
      </a-layout-content>
    </a-layout>
  </a-layout>
</template>

<script lang="ts" setup>
import { ref, onMounted } from 'vue';
import {LaptopOutlined, NotificationOutlined, UserOutlined} from "@ant-design/icons-vue";
import axios from 'axios';
import { useRoute } from 'vue-router';

const openKeys = ref(['sub1']);
const  users = ref([]);
const route = useRoute();
const selectedKeys2 = ref([route.path]);

onMounted(async () => {
  // const URL = process.env["VUE_APP_API_URL"]
  axios.get('/users/findAll').then(res => {
    users.value = res.data;
    console.log(res.data);
  });
});
</script>
<style scoped>

</style>

